clear all
clc
close all

Rz=6400e3;
Rorb=19100e3;
Rsat=Rz+Rorb;
c=3e8;
T=12*3600;
Tmax=12*60*60;
t=0:T:Tmax;
w=2*pi/Tmax;
N=length(t);
Rr(:,1)=[0;Rz];

Rsv(1:2,1:N)=nan;
Rv(1:2,1:N)=nan;
Vsu(1:2,1:N)=nan;
fo=1602e6;

for i=2:N;
Rsv(:,i)=[Rsat*cos(t(i)*w); Rsat*sin(t(i)*w)];
Rv(:,i)=Rsv(:,i)-Rr;
Vsu(:,i)=(Rsv(:,i)-Rsv(:,i-1))/(t(i)-t(i-1));
Vu(:,i)=-dot(Vsu(:,i),Rv(:,i))/norm(Rv(:,i));
fd(:,i)=(fo*Vu(:,i))/c;
end;

plot(Rv(1,:),Rv(2,:));
figure
plot(t,fd);


